package main

import (
	"fmt"
	"gitee.com/hkail/go-docker-test/conf"
	"github.com/gin-gonic/gin"
	"log"
	"net/http"
)

func main() {
	conf.InitConf()

	r := gin.Default()

	r.GET("/", func(c *gin.Context) {
		c.JSON(200, gin.H{"code": 200, "msg": "1.1.3"})
	})

	r.GET("/hello", func(c *gin.Context) {
		c.JSON(200, gin.H{"code": 200, "msg": "66666666"})
	})

	server := http.Server{
		Addr:    fmt.Sprintf(":%d", conf.Conf.Port),
		Handler: r,
	}

	log.Fatalln(server.ListenAndServe())
}
